import request from '../utils/request'

export function getAllUser (params) {
    return request({
        url: '/sys/user',
        params,
        methods: 'get',
    })
}


export function delEmployee (id) {
    return request({
        method: 'delete',
        url: `/sys/user/${id}`
    })
}


export function Addemployee (data) {
    return request({
        method: 'post',
        url: `/sys/user`,
        data
    })
}

export function importEmployee (data) {
    return request({
        url: '/sys/user/batch',
        method: 'post',
        data
    })
}

export function getUserDetailById (id) {
    return request({
        url: `/sys/user/${id}`
    })
}

export function saveUserDetailById (data) {
    return request({
        url: `/sys/user/${data.id}`,
        method: 'put',
        data
    })
}

export function assignRoles (data) {
    return request({
        url: '/sys/user/assignRoles',
        data,
        method: 'put'
    })
}